/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { GroupMemberAddDto } from '../models/GroupMemberAddDto';
import type { GroupMemberAdminAddDto } from '../models/GroupMemberAdminAddDto';
import type { GroupMemberAdminRevokeDto } from '../models/GroupMemberAdminRevokeDto';
import type { GroupMemberDelDto } from '../models/GroupMemberDelDto';
import type { GroupMemberExitDto } from '../models/GroupMemberExitDto';
import type { GroupMemberInvitationDto } from '../models/GroupMemberInvitationDto';
import type { RListGroupMemberListVo } from '../models/RListGroupMemberListVo';
import type { RListGroupMemberVo } from '../models/RListGroupMemberVo';
import type { RListRoomGroupVo } from '../models/RListRoomGroupVo';
import type { RLong } from '../models/RLong';
import type { RRoomGroupVo } from '../models/RRoomGroupVo';
import type { RString } from '../models/RString';

import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';

export class RoomService {

    /**
     * 添加管理员
     * @param requestBody
     * @returns RString OK
     * @throws ApiError
     */
    public static addAdmin(
        requestBody: GroupMemberAdminAddDto,
    ): CancelablePromise<RString> {
        return __request(OpenAPI, {
            method: 'PUT',
            url: '/api/1.0/room/group/admin',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * 撤销管理员
     * @param requestBody
     * @returns RString OK
     * @throws ApiError
     */
    public static revokeAdmin(
        requestBody: GroupMemberAdminRevokeDto,
    ): CancelablePromise<RString> {
        return __request(OpenAPI, {
            method: 'DELETE',
            url: '/api/1.0/room/group/admin',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * 新增群组，点击拉群友操作
     * @param requestBody
     * @returns RLong OK
     * @throws ApiError
     */
    public static addGroup(
        requestBody: GroupMemberAddDto,
    ): CancelablePromise<RLong> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/1.0/room/group',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * 邀请好友
     * @param requestBody
     * @returns RString OK
     * @throws ApiError
     */
    public static addMember(
        requestBody: GroupMemberInvitationDto,
    ): CancelablePromise<RString> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/1.0/room/group/member',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * 移除成员
     * @param requestBody
     * @returns RString OK
     * @throws ApiError
     */
    public static delMember(
        requestBody: GroupMemberDelDto,
    ): CancelablePromise<RString> {
        return __request(OpenAPI, {
            method: 'DELETE',
            url: '/api/1.0/room/group/member',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

    /**
     * 获取一个房间里 群组详情(在线人数，详情)
     * @param roomId
     * @returns RRoomGroupVo OK
     * @throws ApiError
     */
    public static groupDetail(
        roomId: number,
    ): CancelablePromise<RRoomGroupVo> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/api/1.0/room/public/group',
            query: {
                'roomId': roomId,
            },
        });
    }

    /**
     * 获取群成员列表
     * @param roomId
     * @returns RListGroupMemberVo OK
     * @throws ApiError
     */
    public static getMemberPage(
        roomId: number,
    ): CancelablePromise<RListGroupMemberVo> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/api/1.0/room/public/group/member/page',
            query: {
                'roomId': roomId,
            },
        });
    }

    /**
     * 获取群组消息
     * @returns RListRoomGroupVo OK
     * @throws ApiError
     */
    public static queryGroupList(): CancelablePromise<RListRoomGroupVo> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/api/1.0/room/public/group/list',
        });
    }

    /**
     * 房间内的所有群成员列表-@专用
     * @param roomId
     * @returns RListGroupMemberListVo OK
     * @throws ApiError
     */
    public static getMemberList(
        roomId: number,
    ): CancelablePromise<RListGroupMemberListVo> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/api/1.0/room/group/member/list',
            query: {
                'roomId': roomId,
            },
        });
    }

    /**
     * 退出群聊
     * @param requestBody
     * @returns RString OK
     * @throws ApiError
     */
    public static exitGroup(
        requestBody: GroupMemberExitDto,
    ): CancelablePromise<RString> {
        return __request(OpenAPI, {
            method: 'DELETE',
            url: '/api/1.0/room/group/member/exit',
            body: requestBody,
            mediaType: 'application/json',
        });
    }

}
